package top.hekun.study.winlog;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Author: 贺坤
 * @Date: 2021/1/22 16:04
 */
@Getter
@Setter
@Builder
public class Event  implements Comparable<Event> {
    private String id;
    private LocalDateTime time;
    private String type;
    private String category;
    private String source;
    private int statusCode;
    private String log;



    @Override
    public int compareTo(Event o) {
        return o.getTime().compareTo(this.getTime());
    }

    @Override
    public String toString() {
        return "Event: {" +
                "id:" + id +
                ", time:" + time +
                ", type:'" + type + '\'' +
                ", category:'" + category + '\'' +
                ", source:'" + source + '\'' +
                ", statusCode:'" + statusCode + '\'' +
                ", log:'" + log + '\'' +
                '}';
    }


}
